Morph data associated with deforming this mesh. More...
#include <kanzi/core.ui/graphics3d/mesh.hpp>
Classes | |
| class | MorphShape |
| Morph shape. More... | |
Public Member Functions | |
| void | addShape (string_view name, float weight) |
| Adds a morph shape. | |
| void | allocateShapes (size_t shapeCount) |
| Allocates the shape array. | |
| void | createBuffer (Renderer &renderer, string_view name, gfx::BufferHandleGuard bufferHandle, size_t dataSize) |
| Create the internal vertex buffer using an external buffer handle, but do not deploy data. | |
| void | createBuffer (Renderer &renderer, string_view name, size_t dataSize) |
| Create the internal vertex buffer, but do not deploy data. | |
| void | deploy (Renderer &renderer, string_view name, const vector< byte > &data) |
| Deploy the morph data to the GPU. | |
| void | destroyBuffer () |
| Destroy the GPU-side data. | |
| size_t | getBufferDataSize () const |
| Gets the data size to use for buffers. | |
| size_t | getCPUMemoryUsage () const |
| Gets the GPU memory usage of the morph data. | |
| size_t | getDataTextureNormalOffset () const |
| Gets the data texture normal offset. | |
| size_t | getDataTexturePositionOffset () const |
| Gets the data texture position offset. | |
| size_t | getDataTextureTangentOffset () const |
| Gets the data texture tangent offset. | |
| size_t | getDataTextureTargetSize () const |
| Gets the data texture target size. | |
| size_t | getGPUMemoryUsage () const |
| Gets the GPU memory usage of the morph data. | |
| gfx::BufferHandleGuard | getHandle () const |
| Gets the handle of the morph buffer. | |
| const MorphShape & | getShape (size_t idx) const |
| Gets a shape by index. | |
| size_t | getShapeCount () const |
| Gets the number of shapes. | |
| const vector< MorphShape > & | getShapes () const |
| Gets the shape array. | |
| size_t | getTargetCount () const |
| Gets the morph target count. | |
| size_t | getTargetSize () const |
| Gets the target size. | |
| size_t | getVertexCount () const |
| Gets the vertex count. | |
| const MeshVertexFormat & | getVertexFormat () const |
| Gets the vertex format. | |
| bool | hasVertexBuffer () const |
| Indicates whether or not the morph data has a vertex buffer. | |
| bool | isDeployed () const |
| Indicates whether or not the morph data is deployed to the GPU. | |
| void | setDataTextureSettings (size_t positionOffset, size_t normalOffset, size_t tangentOffset, size_t targetSize) |
| Sets the data texture settings. | |
| void | setShape (size_t idx, string_view name, float weight) |
| Sets given shape by index. | |
| void | setVertexCount (size_t vertexCount) |
| Sets the vertex count. | |
| void | setVertexData (vector< byte > vertexData) |
| Sets the vertex data. | |
| void | setVertexFormat (const MeshVertexFormat &vertexFormat) |
| Sets the vertex format. | |
| void | updateTargetSize () |
| Updates the target size based on vertex format and vertex count. | |
Protected Attributes | |
| size_t | m_dataTextureNormalOffset |
| Data texture normal offset. | |
| size_t | m_dataTexturePositionOffset |
| Data texture position offset. | |
| size_t | m_dataTextureTangentOffset |
| Data texture tangent offset. | |
| size_t | m_dataTextureTargetSize |
| Data texture target size. | |
| vector< MorphShape > | m_shapes |
| Morph shapes. | |
| size_t | m_targetSize |
| Size of one full morph target in bytes. | |
| GPUBufferUniquePtr | m_vertexBuffer |
| Buffer for GPU-side vertex data. | |
| size_t | m_vertexCount |
| Number of vertices per morph target. | |
| vector< byte > | m_vertexData |
| Raw vertex data. | |
| MeshVertexFormat | m_vertexFormat |
| Morph-specific vertex format. | |
Morph data associated with deforming this mesh.
To animate morph weights, animate the Model3D::Morphing property in a Model3D that has a Mesh containing Mesh::MorphData:
| void kanzi::Mesh::MorphData::createBuffer | ( | Renderer & | renderer, |
| string_view | name, | ||
| gfx::BufferHandleGuard | bufferHandle, | ||
| size_t | dataSize ) |
| void kanzi::Mesh::MorphData::destroyBuffer | ( | ) |
Destroy the GPU-side data.
|
inline |
Indicates whether or not the morph data is deployed to the GPU.
|
inline |
Gets a shape by index.
| idx | Index of a shape. |
|
inline |
Gets the number of shapes.
|
inline |
Gets the shape array.
|
inline |
Gets the morph target count.
Adds a morph shape.
| name | Shape name. |
| weight | Shape weight. |
|
inline |
Allocates the shape array.
| shapeCount | Number of shapes. |
Sets given shape by index.
| idx | Index. |
| name | Shape name. |
| weight | Shape weight. |
|
inline |
Gets the vertex count.
|
inline |
Gets the vertex format.
|
inline |
Gets the target size.
|
inline |
Sets the vertex count.
| vertexCount | Vertex count. |
|
inline |
Sets the vertex format.
| vertexFormat | Vertex format. |
|
inline |
Updates the target size based on vertex format and vertex count.
|
inline |
Gets the data size to use for buffers.
The data size is aligned to 4 bytes.
|
inline |
Sets the vertex data.
Target size and target count must be set prior to assigning the data. The input data is extended to buffer data size if necessary.
| vertexData | Vertex data blob to set. |
|
inline |
Gets the data texture position offset.
|
inline |
Gets the data texture normal offset.
|
inline |
Gets the data texture tangent offset.
|
inline |
Gets the data texture target size.
|
inline |
Sets the data texture settings.
| positionOffset | Data texture position offset. |
| normalOffset | Data texture normal offset. |
| tangentOffset | Data texture tangent offset. |
| targetSize | Data texture morph target size. |
|
inline |
Gets the GPU memory usage of the morph data.
|
inline |
Gets the GPU memory usage of the morph data.
|
inline |
Indicates whether or not the morph data has a vertex buffer.
|
inline |
Gets the handle of the morph buffer.
|
protected |
Buffer for GPU-side vertex data.
|
protected |
Morph shapes.
|
protected |
Number of vertices per morph target.
|
protected |
Size of one full morph target in bytes.
|
protected |
Morph-specific vertex format.
|
protected |
Raw vertex data.
|
protected |
Data texture position offset.
|
protected |
Data texture normal offset.
|
protected |
Data texture tangent offset.
|
protected |
Data texture target size.